<template>
  <div class="header">
    <div class="header-left">
      <span class="iconfont icon-back">&#xe624;</span>
    </div>
    <div class="header-input">
      <span class="iconfont">&#xe632;请输入城市/景点/游玩主题</span>
    </div>
    <router-link to="/city">
      <div class="header-right">
        <span class="txt">{{this.city}}</span>
        <span class="iconfont icon-arrow">&#xe65c;</span>
      </div>
    </router-link>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default{
  name: 'Home',
  computed: {
    ...mapState(['city'])
  }
}
</script>

<style lang="stylus" scoped>
@import '~styles/variable.styl'
@import '~styles/mixins.styl'
  .header
    display:flex
    line-height: .86rem
    background-color: $bgColor
    color: #fff
    .header-left
      width: .64rem
      float: left
      text-align: center
      margin-right: .2rem
    .header-input
      flex: 1
      border-radius: .1rem
      line-height: .64rem
      height: .64rem
      margin-top: .12rem
      background-color: #fff
      color: #ccc
      font-size: 0
      padding-left: .2rem
    .header-right
      display flex
      color #fff
      width: 1.24rem
      float: right
      text-align: center
      justify-content center
      .txt
        max-width .6rem
        ellipsis()
        display inline-block
</style>
